{*
  Object Pascal simple sound playback routines
  @Author  Maciej Zagozda (1998-2008)
  @Licence Microsoft Reciprocal License (Ms-RL)
  @Website http://www.codeplex.com/intelitechdelphirtns/
  @Version 2008/04/20 Added documentation support
}

unit SoundRoutines;

interface

uses
  Classes,
  Controls,
  Dialogs,
  Forms,
  Graphics,
  Messages,
  MMSystem,
  Registry,
  SysUtils,
  Windows;

function PlayWave( strnFilename: AnsiString ): LongBool;
function PlayLoopWave( strnFilename: AnsiString ): LongBool;
function StopLoopWave: LongBool;

implementation

function PlayWave( strnFilename: AnsiString ): LongBool;
begin
  Result := sndPlaySoundA( PChar( strnFilename ), SND_ASYNC );
end;

//_____________________________________________________________________________

function PlayLoopWave( strnFilename: AnsiString ): LongBool;
begin
  Result := sndPlaySoundA( PChar( strnFilename ), SND_LOOP or SND_ASYNC );
end;

//_____________________________________________________________________________

function StopLoopWave: LongBool;
begin
  Result := sndPlaySoundA( nil, SND_LOOP or SND_ASYNC );
end;


end.
